package br.com.jf.componentes;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import br.com.jf.exceptions.ParentNotFoundException;

public class PanelContentTag extends BodyTagSupport{

	
	@Override
	public int doEndTag() throws JspException {
		
		try{

			if(getParent().getClass() != PanelTag.class){
				
				throw new ParentNotFoundException();
			}

			pageContext.getOut().write(getBodyContent().getString());
			
			
		}catch(Exception a){
			
			a.printStackTrace();
		}
		
		
		return super.doEndTag();
	}
}
